.addDirectoryPopoverOverlay {

  :global {
    .ant-form-item {
      margin-bottom: 8px;
    }

    .ant-btn-primary {
      margin-left: 8px;
    }
  }
}

.imageBlobs {
  display: flex;
  height: 100%;

  :global {
    header {
      background: var(--mall-store-background-color);
      padding: 8px;
      display: flex;
      align-items: center;
    }

    .ant-empty {
      margin-top: 44px;
    }

    .ant-pagination {
      margin-top: 12px;
      text-align: right;
    }
  }

  .directories {
    box-sizing: content-box;
    background: var(--mall-store-background-color);
    padding: 0 8px 8px 8px;
    width: 220px;

    .directoryTree {
      padding: 8px 0;
      margin-top: 8px;
      border-top: 1px solid var(--mall-store-border-color);
      background: var(--mall-store-background-color);
      overflow: auto;

      .directoryTreeNode {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 0 0 4px;

        :global {
          .anticon {
            padding: 4px;
          }
        }
      }

      .directoryTreeNodeEditable {
        display: flex;
        align-items: center;
        padding: 0 1px;


        :global {
          .ant-input-sm {
            border: none;
            border-radius: 0;
            padding: 0 4px;
          }

          .anticon {
            padding: 4px;
          }
        }
      }

      :global {

        .ant-tree-node-content-wrapper {
          padding: 0;
        }

        .ant-tree-switcher-noop {
          display: none;
        }

        .ant-tree-title {
          height: 100%;
          width: 100%;
          display: inline-block;
        }
      }
    }

    :global {
      .ant-btn {
        width: 100%;
        margin-top: 8px;
      }
    }
  }

  .imageBlobsContent {
    width: 100%;
    margin-left: 12px;

    .uploadImageBlobs {

      :global {
        header {
          background: var(--mall-store-background-color);
          padding: 8px;
          display: flex;
          align-items: center;
          justify-content: flex-end;
        }
      }

      .uploadImageBlobList {
        display: flex;
        flex-wrap: wrap;

        .uploadImageBlobButton {
          display: inline-flex;
          align-items: center;
          justify-content: center;
          margin-top: 12px;
          border: 1px dashed var(--mall-store-border-color);
          border-radius: 4px;
          width: 98px;
          height: 98px;
          cursor: pointer;
          user-select: none;
          flex-direction: column;

          &:focus, &:hover {
            border: 1px dashed var(--mall-store-primary-color);
          }

          :global {
            .anticon-plus {
              font-size: 2em;
            }

            input[type="file"] {
              display: none;
            }
          }
        }

        .uploadImageBlob {
          display: inline-block;
          margin: 12px 12px 0 0;
          user-select: none;
          position: relative;

          %imageBlobBaseScreen {
            display: flex;
            align-items: center;
            justify-content: center;
            background: linear-gradient(180deg, rgba(33, 43, 54, .55), hsla(0, 0%, 100%, 0));
            border-radius: 4px;
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;

            :global {
              .anticon {
                display: none;
              }
            }
          }

          .uploadImageBlobUploading {
            @extend %imageBlobBaseScreen;
            opacity: 1;

            :global {
              .anticon-loading {
                display: initial;
                color: #fff;
                font-size: 26px;
              }
            }
          }

          .uploadImageBlobUploaded {
            @extend %imageBlobBaseScreen;
            opacity: 1;

            :global {
              .anticon-check-circle {
                display: initial;
                color: var(--mall-store-success-color);
                font-size: 26px;
              }
            }
          }

          .uploadImageBlobActions {
            @extend %imageBlobBaseScreen;
            cursor: pointer;
            opacity: 0;

            &:focus, &:hover {
              transition: opacity .1s cubic-bezier(0, 0, .42, 1);
              opacity: 1;
            }

            :global {
              .anticon-delete {
                display: initial;
                position: absolute;
                top: 6px;
                right: 6px;
                color: hsla(0, 0%, 100%, .9);
              }

              .anticon-expand-alt {
                display: initial;
                color: #fff;
                font-size: 26px;
              }
            }
          }

          :global {
            img {
              border: 1px solid var(--mall-store-border-color);
              user-select: none;
              border-radius: 4px;
              width: 100px;
              height: 100px;
            }
          }
        }
      }

      .uploadImageBlobDropzone {
        cursor: pointer;
        margin-top: 12px;
        border: 1px dashed var(--mall-store-border-color);
        padding: 24px;
        text-align: center;

        :global {
          svg {
            width: 100px;
            margin-bottom: 8px;
          }
        }
      }

    }

    .manageImageBlobs {
      min-height: 370px;

      .manageImageBlob {
        display: inline-flex;
        flex-direction: column;
        margin: 12px 12px 0 0;

        .manageImageBlobTitle {
          display: inline-flex;
          margin-top: 4px;

          :global {
            .ant-checkbox-wrapper {
              overflow: hidden;
              white-space: nowrap;
              text-overflow: ellipsis;
              width: 135px;
            }
          }
        }

        .manageImageBlobActions {
          text-align: center;

          :global {
            .ant-btn-link {
              padding: 0;
              font-size: 12px;
            }

            .ant-divider-vertical {
              margin: 0 4px;
            }
          }
        }

        :global {
          img {
            width: 135px;
            height: 135px;
            background: var(--mall-store-background-color);
            user-select: none;
          }
        }
      }
    }

    .selectImageBlobs {
      .selectImageBlobsContent {
        min-height: 300px;
      }

      .selectImageBlob {
        display: inline-block;
        position: relative;
        margin: 12px 12px 0 0;
        user-select: none;
        cursor: pointer;

        .imageBlobSelected {
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          border: 2px solid var(--mall-store-primary-color);
          z-index: 2;

          &:after {
            position: absolute;
            display: block;
            content: " ";
            right: 0;
            top: 0;
            border-color: var(--mall-store-primary-color) var(--mall-store-primary-color) transparent transparent;
            border-style: solid;
            border-width: 14px;
          }

          .imageBlobSelectedIndex {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            position: absolute;
            right: 0;
            top: 0;
            font-size: 12px;
            color: #fff;
            width: 15px;
            height: 15px;
            z-index: 3;
          }
        }

        :global {
          img {
            border-radius: 4px;
            width: 100px;
            height: 100px;
            background: var(--mall-store-background-color);
          }

          footer {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, .4);
            color: #fff;
            height: 20px;
            line-height: 20px;
            text-align: center;
          }
        }
      }
    }
  }

}

.imageBlobsPopover {
  position: fixed;
  left: 0;
  top: 0;
}

.imageBlobsPopoverOverlay {


  :global {
    .ant-popover-arrow {
      display: none;
    }

    .ant-popover-inner {
      width: 700px;
      max-height: 400px;
      overflow: auto;
    }

    .ant-popover-inner-content {
      padding: 12px;
      height: 100%;
    }
  }
}
